home *** CD-ROM | disk | FTP | other *** search
/ ASME's Mechanical Engine…ing Toolkit 1997 December / ASME's Mechanical Engineering Toolkit 1997 December.iso / cad_elec / gerbtool.exe / DATA.1 / SHIP.MAC < prev    next >
Text File  |  1995-10-23  |  2KB  |  71 lines

  1. MACRO ship
  2.  
  3.     SetPrompt "Ship", "waiting..."
  4.  
  5.     MessageBox "Design Shipper", "This macro ZIPs all files required to ship the\n \
  6.                     currently loaded design as a single file.\nPKZIP.EXE must be in the PATH!\nContinue?", 1
  7.  
  8.     IF $$STATUS == $$NO
  9.         STOP
  10.     END
  11.  
  12.     MessageBox "Warning", "This macro does not scan for Custom apertures.\n \
  13.                           It is assumed that you have expanded all Custom\n \
  14.                           apertures with the Edit/Dcode/Expand command prior\n \
  15.                           to running this macro.\nContinue?", 1
  16.  
  17.     IF $$STATUS == $$NO
  18.         STOP
  19.     END
  20.  
  21.     Set $lyr = 1
  22.  
  23.     FileOpen $fd, "_ziplst_", "w"
  24.     FileWrite $fd, "%s", $$DSNNAME
  25.  
  26.     REPEAT $lyr <= $$MAXLAYERS
  27.  
  28.         GetLayer $lyr, $fn, $ln, $ap, $vis, $fc, $dc, $type, \
  29.                      $pol, $key, $ftype, $lx, $ly, $ux, $uy, $netid
  30.  
  31.         IF $$STATUS
  32.             FileWrite $fd, "%s\n%s", $fn, $ap
  33.         END
  34.  
  35.         Calc $lyr = $lyr + 1
  36.  
  37.     END
  38.  
  39.     FileClose $fd
  40.  
  41.     SplitPath $$DSNNAME, $dir, $file, $ext
  42.  
  43.     StrWrite $zipfile, "%s\%s.zip", $dir, $file        # compose the zip filename
  44.     FileOpen $fd, $zipfile, "r"                            # see if it exists already
  45.  
  46.     IF $$STATUS
  47.  
  48.         FileClose $fd            # it does exist
  49.  
  50.         StrWrite $msg, "%s already exists!\nContinue?", $zipfile
  51.         MessageBox "Design Compression", $msg, 1
  52.  
  53.         IF $$STATUS == $$NO
  54.             STOP
  55.         END
  56.  
  57.     END
  58.  
  59.     StrWrite $cmdline, "pkzip %s @_ziplst_", $zipfile
  60.  
  61.     SetPrompt "Ship", "zipping..."
  62.     SysCmd $cmdline
  63.  
  64.     SysCmd "del _ziplst_"
  65.  
  66.     SetPrompt "Ship", "waiting..."
  67.  
  68.     StrWrite $msg, "Your design has been zipped into %s", $zipfile
  69.     MessageBox "Design Shipper", $msg, 0
  70.  
  71. ENDMACRO